1 00:00:00,500 --> 00:00:03,430 All right, one more thing for our Kills Death leaderboard. 2 00:00:03,440 --> 00:00:08,300 Let's give points for a zombie kill or for any monster kill. 3 00:00:08,300 --> 00:00:14,090 And I'll also show you where you can add code if you want to actually grant the player kills for non 4 00:00:14,090 --> 00:00:15,270 playing characters. 5 00:00:15,290 --> 00:00:16,790 Let's go to a zombie first. 6 00:00:16,790 --> 00:00:20,210 We have these two floating around here in the world and I'm going to. 7 00:00:20,910 --> 00:00:22,420 Check this out. 8 00:00:22,440 --> 00:00:23,910 This is a roadblocks product, too. 9 00:00:23,910 --> 00:00:25,920 And they just name this script. 10 00:00:26,340 --> 00:00:31,230 So just just be aware of that because I'm going to add a script. 11 00:00:32,170 --> 00:00:34,770 And then I'm going to get confused of which one it is. 12 00:00:34,780 --> 00:00:39,910 So the one I just added is, of course, the one I want to add code to, not that other one that's already 13 00:00:39,910 --> 00:00:40,840 full of stuff. 14 00:00:41,140 --> 00:00:47,530 I'm going to do a variable char for the character, for the zombie character. 15 00:00:47,530 --> 00:00:56,440 So script parent and then I'm going to do a variable for the humanoid we get from the char and we'll 16 00:00:56,440 --> 00:00:57,340 do way for child. 17 00:00:57,340 --> 00:01:00,700 You don't really need it here because it is on the server. 18 00:01:00,700 --> 00:01:02,650 You can just do char dot humanoid. 19 00:01:02,650 --> 00:01:08,470 It would work fine, but I'm just being careful and then we're going to get the humanoid died event 20 00:01:08,470 --> 00:01:09,880 of the zombie. 21 00:01:09,970 --> 00:01:18,510 We're going to connect that and then we're going to get a tag to see if there is a tag on the humanoids 22 00:01:18,520 --> 00:01:20,380 or do a fine first child. 23 00:01:20,860 --> 00:01:34,030 And I'm going to look for the tag called Creator will say If tag and tag value, then we will get the 24 00:01:34,030 --> 00:01:42,790 enemy player of the zombie e player tag dot value and. 25 00:01:44,010 --> 00:01:47,710 If you want to do kills, you could do the kills here. 26 00:01:47,730 --> 00:01:49,740 I'm just going to do the points right now. 27 00:01:49,740 --> 00:01:53,610 So I'll say e player dot leader stats. 28 00:01:53,610 --> 00:01:54,600 That's that's you. 29 00:01:54,600 --> 00:01:57,360 If you kill the zombie, you're its enemy. 30 00:01:57,510 --> 00:02:04,380 I'll do points dot value plus equals what you give them 20 points. 31 00:02:04,380 --> 00:02:05,610 20 points for kill. 32 00:02:05,760 --> 00:02:06,420 There we go. 33 00:02:06,420 --> 00:02:11,700 So if you want kills, I'm not going to add this to the game, but I'll just show you real quick if 34 00:02:11,700 --> 00:02:13,230 you want kills. 35 00:02:14,860 --> 00:02:20,970 Just change this to kills and then you'll do the plus equals one. 36 00:02:20,980 --> 00:02:25,150 And let me comment that out because I don't want that in my game. 37 00:02:25,150 --> 00:02:25,990 But you might. 38 00:02:25,990 --> 00:02:28,980 And I just wanted to make sure that you knew how to do that. 39 00:02:28,990 --> 00:02:30,250 That's pretty cool. 40 00:02:30,250 --> 00:02:33,010 Now I'm going to get that script. 41 00:02:33,010 --> 00:02:35,230 I'm going to rename it because. 42 00:02:36,260 --> 00:02:37,520 That's the other one. 43 00:02:37,910 --> 00:02:39,420 That's the one I just did. 44 00:02:39,440 --> 00:02:42,110 Let's rename that to give points. 45 00:02:42,500 --> 00:02:44,600 Give points? 46 00:02:44,780 --> 00:02:45,860 I'm going to copy it. 47 00:02:47,880 --> 00:02:49,830 I'll put it in my other zombie. 48 00:02:50,100 --> 00:02:53,430 These two loose zombies floating around paste into. 49 00:02:53,430 --> 00:02:58,920 But we're not going to use the collection service or the tagging for this because almost everything 50 00:02:58,920 --> 00:02:59,670 is spawned. 51 00:02:59,670 --> 00:03:00,180 Right? 52 00:03:00,180 --> 00:03:04,960 So I'll just go down to server storage and then I'll paste into. 53 00:03:04,980 --> 00:03:06,660 We'll give that give points. 54 00:03:06,660 --> 00:03:10,740 And then I think we had zombies in our simple zombie spotter. 55 00:03:12,130 --> 00:03:20,110 Let's go ahead and select all of these right click paste into selected and we should have our give points 56 00:03:20,110 --> 00:03:21,640 on all of those. 57 00:03:22,300 --> 00:03:22,840 All right. 58 00:03:22,840 --> 00:03:23,590 Let's try it out. 59 00:03:23,590 --> 00:03:26,710 Let's see if we get some points for some zombie kills. 60 00:03:28,640 --> 00:03:29,120 Oh, man. 61 00:03:29,120 --> 00:03:30,260 I should have done a play from here. 62 00:03:30,290 --> 00:03:31,180 That's all right. 63 00:03:31,190 --> 00:03:32,830 Let's try out our. 64 00:03:32,840 --> 00:03:37,700 We haven't done anything with this in a while, and then we'll get our our coins, and we'll be able 65 00:03:37,700 --> 00:03:38,870 to run real fast. 66 00:03:41,560 --> 00:03:42,310 Cool. 67 00:03:43,300 --> 00:03:45,190 Turn to release Valve. 68 00:03:47,600 --> 00:03:48,340 Ah, yeah. 69 00:03:48,350 --> 00:03:49,040 Here they come. 70 00:03:54,830 --> 00:03:56,130 30 points. 71 00:03:56,150 --> 00:03:56,720 That's right. 72 00:03:56,720 --> 00:03:58,240 Because I got the coin and then as I. 73 00:04:04,930 --> 00:04:05,490 Yeah. 74 00:04:05,500 --> 00:04:06,190 Looking good. 75 00:04:06,190 --> 00:04:07,250 We're getting some kills. 76 00:04:07,270 --> 00:04:08,010 Let's run over here. 77 00:04:08,020 --> 00:04:08,980 Make sure that other one. 78 00:04:08,980 --> 00:04:11,850 Oh, we killed those zombies with. 79 00:04:11,890 --> 00:04:12,820 With the. 80 00:04:13,030 --> 00:04:14,500 With the eruption. 81 00:04:14,680 --> 00:04:15,130 Here we go. 82 00:04:15,130 --> 00:04:17,140 We got some spawned ones over here. 83 00:04:22,690 --> 00:04:23,170 Yep. 84 00:04:23,170 --> 00:04:23,730 90. 85 00:04:23,740 --> 00:04:24,800 Looking good. 86 00:04:24,880 --> 00:04:28,000 So we're getting some points for our kills.